package com.csdig.cms.model;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

public class Content implements java.io.Serializable {

	private static final long serialVersionUID = 0L;

	// public static final String DB_NAME = "cms";

	// columns START
	/**
	 * contentId db_column: content_id
	 */
	private java.lang.Integer contentId;
	/**
	 * channelId db_column: channel_id
	 */
	private java.lang.Integer channelId;
	/**
	 * title db_column: title
	 */
	private java.lang.String title;
    private String titleImg;
	/**
	 * description db_column: description
	 */
	private java.lang.String description;
	/**
	 * link db_column: link
	 */
	private java.lang.String link;
	/**
	 * releaseDate db_column: release_date
	 */
	private java.util.Date releaseDate;
	/**
	 * viewCount db_column: view_count
	 */
	private java.lang.Integer viewCount = Integer.valueOf(0);
	/**
	 * ups db_column: ups
	 */
	private java.lang.Integer ups = Integer.valueOf(0);
	/**
	 * downs db_column: downs
	 */
	private java.lang.Integer downs = Integer.valueOf(0);
	// columns END

	private ContentTxt txt = new ContentTxt();
	private List<ContentTag> tagList = new ArrayList<ContentTag>();
	private List<ContentAttr> attrs = new ArrayList<ContentAttr>();

	// constructors
	public Content() {
	}

	public void setContentId(java.lang.Integer value) {
		this.contentId = value;
	}

	public java.lang.Integer getContentId() {
		return this.contentId;
	}

	public void setChannelId(java.lang.Integer value) {
		this.channelId = value;
	}

	public java.lang.Integer getChannelId() {
		return this.channelId;
	}

	public void setTitle(java.lang.String value) {
		this.title = value;
	}

	public java.lang.String getTitle() {
		return this.title;
	}

    public String getTitleImg() {
        return titleImg;
    }

    public void setTitleImg(String titleImg) {
        this.titleImg = titleImg;
    }

    public void setDescription(java.lang.String value) {
		this.description = value;
	}

	public java.lang.String getDescription() {
		return this.description;
	}

	public void setLink(java.lang.String value) {
		this.link = value;
	}

	public java.lang.String getLink() {
		return this.link;
	}

	public void setReleaseDate(java.util.Date value) {
		this.releaseDate = value;
	}

	public java.util.Date getReleaseDate() {
		return this.releaseDate;
	}
	
	public java.lang.String getFormatReleaseDate() {
		if(this.releaseDate!=null){
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			return sdf.format(releaseDate);
		}
		return "";
	}

	public void setViewCount(java.lang.Integer value) {
		this.viewCount = value;
	}

	public java.lang.Integer getViewCount() {
		return this.viewCount;
	}

	public void setUps(java.lang.Integer value) {
		this.ups = value;
	}

	public java.lang.Integer getUps() {
		return this.ups;
	}

	public void setDowns(java.lang.Integer value) {
		this.downs = value;
	}

	public java.lang.Integer getDowns() {
		return this.downs;
	}

	public ContentTxt getTxt() {
		return txt;
	}

	public void setTxt(ContentTxt txt) {
		this.txt = txt;
	}

	public List<ContentTag> getTagList() {
		return tagList;
	}

	public void setTagList(List<ContentTag> tagList) {
		this.tagList = tagList;
	}

	public List<ContentAttr> getAttrs() {
		return attrs;
	}

	public void setAttrs(List<ContentAttr> attrs) {
		this.attrs = attrs;
	}
	
}
